UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pz6LnGbfqH+zAh4jfYCM8tsmpgqPBhbixVIvHFmok6E='
WHERE
key_id = '3d5d4fdd7ff24de0f936e23fdf11f33bb92701a783c5bc23a234d75282b47b5a'
AND (
token = 'pz6LnGbfqH+zAh4jfYCM8tsmpgqPBhbixVIvHFmok6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)