UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2gek8xAIATHry7q3tT1sBiSjPIEdYREyA4Da2tzpN88='
WHERE
key_id = '15e7da4a404fb7b17f0ea9db199734d7a1d93a066e9fefbc37ac569eab16002f'
AND (
token = '2gek8xAIATHry7q3tT1sBiSjPIEdYREyA4Da2tzpN88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)