UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hB9jIy5pf7h83ImkNjezgW0+8EwSUg/McLuu30ri6W8=' 
WHERE 
  key_id = 'c2260e8cb31cab9e204e3a2bc5b074eecb85f98f3fee7fc45ee2699287996d77' 
  AND (
    token = 'hB9jIy5pf7h83ImkNjezgW0+8EwSUg/McLuu30ri6W8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067