UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6FpHKbru+diFkH8pS9OIlC4JO5n2tWROrwPKFc/ITms=' 
WHERE 
  key_id = '83e4d513aef6fcdfb42c81a2e09fa95a5d86edb265f83d404b7228e6572d20c5' 
  AND (
    token = '6FpHKbru+diFkH8pS9OIlC4JO5n2tWROrwPKFc/ITms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030