UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YjSc0O5stsFf84orw1kJUk3fJypPfVDaILTl56yX7po=' 
WHERE 
  key_id = '10f9082c1e4c2f3aeab3fbc4fd24b7b3b4410145335a474765e6631eb3d1d7e9' 
  AND (
    token = 'YjSc0O5stsFf84orw1kJUk3fJypPfVDaILTl56yX7po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045