UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HCbHUUH0qfAssDTnQyzDLbUzXVaJFXC5RDDKZhNPQp4=' 
WHERE 
  key_id = '176621d283cc11c549e38567b137f10d38a0d1fdf1733cc86ae3d792f7f28d5d' 
  AND (
    token = 'HCbHUUH0qfAssDTnQyzDLbUzXVaJFXC5RDDKZhNPQp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031