UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yfVekVigHntCKfElPhQJgCn66XV8awlZ9wlgBkCWqCI=' 
WHERE 
  key_id = '019c4a6719130cef6fb11749a5412d174053abc74a4c36f2700e34b942bc2be1' 
  AND (
    token = 'yfVekVigHntCKfElPhQJgCn66XV8awlZ9wlgBkCWqCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016