UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kJIZpkzMpJMSXVIpir46jFPYl8nIk19iBXUXtpoAW1g='
WHERE
key_id = '04342348b2ad922ed7d5beff47d046ac6f36b4ef36742b496d637c3eb6436704'
AND (
token = 'kJIZpkzMpJMSXVIpir46jFPYl8nIk19iBXUXtpoAW1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)