UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zucKerWkAW5H84C/NfUtH8Hzc+oh8xndqUN/lwO7GIQ='
WHERE
key_id = '81851b301a0362f29f53c4bcb2123e2ada7e4fa05d0317582d989389ceb730de'
AND (
token = 'zucKerWkAW5H84C/NfUtH8Hzc+oh8xndqUN/lwO7GIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)