UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LagDgI7AVl2db4Q2sAzmMudHwWnTr77hnr8GhkkXsOU=' 
WHERE 
  key_id = 'f2704724af0585d9da23f0537cecc5a6887c6fd2d4552299f91efd28f55b4dbd' 
  AND (
    token = 'LagDgI7AVl2db4Q2sAzmMudHwWnTr77hnr8GhkkXsOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044