UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6g5LAJCDKPK6SPvwOWo1Q/b0AMmkFrZnFGvMgHax0yE=' 
WHERE 
  key_id = '57fcd86eed135fb6747331d82a80ea67bda3358056e99f45e5db9d165e6ec939' 
  AND (
    token = '6g5LAJCDKPK6SPvwOWo1Q/b0AMmkFrZnFGvMgHax0yE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046