UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zlZqTV87qiBIBg22SON+cvF7aXrwAk9dmxZtfhG3FaU='
WHERE
key_id = 'f4e80aa7432db009737731bb82f97e2415cef05e000b6dcd25e2eb15666b99f4'
AND (
token = 'zlZqTV87qiBIBg22SON+cvF7aXrwAk9dmxZtfhG3FaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)