UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dzjU7D3bwY1XlCMBkIoXPNXa5Tke+K7EZtZPTjclQWo='
WHERE
key_id = 'fb85609c0e0941dc77dcb9eacfca4a1fc51c4d3b543e7dc8ddafaf248d0a3328'
AND (
token = 'dzjU7D3bwY1XlCMBkIoXPNXa5Tke+K7EZtZPTjclQWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)