UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yvTQWHS45LRD5jkl8oQh9FguBrhJMidj6ZZ4Av7XbAI='
WHERE
key_id = 'fb369b98798bc1c7110b32ed5cbc310846756eda9a659181a4b9b1d57c07614f'
AND (
token = 'yvTQWHS45LRD5jkl8oQh9FguBrhJMidj6ZZ4Av7XbAI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)