UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ldRtK0ueJ1kbVbQxcnFTSz7MgOiILE/3tKvfNVnZrNk='
WHERE
key_id = 'fd09b8f7fd84965c13aaf068bf42d59144087f88c26fe68ac7257a4a535d0393'
AND (
token = 'ldRtK0ueJ1kbVbQxcnFTSz7MgOiILE/3tKvfNVnZrNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)