UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ha7qJEDjdaPJplK42mx1XtRAimLXBZ20jZGaJj0QsU0=' 
WHERE 
  key_id = '61ffffa8eba0f81686109850637f05322a8d786d756ac56bb03f5cb4281e479d' 
  AND (
    token = 'Ha7qJEDjdaPJplK42mx1XtRAimLXBZ20jZGaJj0QsU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026