UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RkdFnAoDDNq/DsGoUcgvc05PSVr9kxIp+pWCh2w86w4='
WHERE
key_id = 'fc694bd2c2c2c45f0b7b5fa99e21a5ac975c0859731e05a224627c7badcab80c'
AND (
token = 'RkdFnAoDDNq/DsGoUcgvc05PSVr9kxIp+pWCh2w86w4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)