UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bC8xpGNe3vkuGQYvSgkH0Uwb2pqhFlf27SyJ7SaNz3s='
WHERE
key_id = '8fc73125a1710f03452d435ea4f5b88149bfe2ea98ca2cf7a1a1a631178f109b'
AND (
token = 'bC8xpGNe3vkuGQYvSgkH0Uwb2pqhFlf27SyJ7SaNz3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)