UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XPkg/QrX4Rj80GHIxg2IVu5BQRgRQJY/U5jcYgRBLf0='
WHERE
key_id = 'd8cb24bc4d2e4fcb69b3cbbc9d35251b8420a66ba45d705d8af1a9da6b13fb19'
AND (
token = 'XPkg/QrX4Rj80GHIxg2IVu5BQRgRQJY/U5jcYgRBLf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)