UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zx3Ql1RRtNSeGfzqiqkx+FTQbjBspwtBQK00A3KRVRc='
WHERE
key_id = '94b22bdfade9ea5cc888c2b34249bdab12a223b13ad725fcbe2b42aae9ad6adb'
AND (
token = 'Zx3Ql1RRtNSeGfzqiqkx+FTQbjBspwtBQK00A3KRVRc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)