UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ly4EOgPyv32ixe5KNPfqS2pgCS8rfzJUKH6LCD2R/ro=' 
WHERE 
  key_id = '2536ef1f1a077c1d5dca30d42cbcd705652b4c69efca40a073e0916a1d68887c' 
  AND (
    token = 'Ly4EOgPyv32ixe5KNPfqS2pgCS8rfzJUKH6LCD2R/ro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039