UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7jOjmhcXBJenneyfpFe4ew3oH2eZj/KpJt8ygqjcvlE='
WHERE
key_id = '3fd519007a5419bfde9312d71e7b3e18a6ea531ea74da778ad8a106d5aaf656f'
AND (
token = '7jOjmhcXBJenneyfpFe4ew3oH2eZj/KpJt8ygqjcvlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)