UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8AAmM6JNWO5TsZkT0V3sIZg8gMF7TeGI55/0oVzN1g='
WHERE
key_id = '8d46390a94aafaabb8b77cbfdc97d818382be58fa0b5447e64ea1dd00ab3bc74'
AND (
token = 'F8AAmM6JNWO5TsZkT0V3sIZg8gMF7TeGI55/0oVzN1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)