UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q3TsyXJeu/jVrwImFj/kXMeW3xPgxAYqiuOIZHtGtIY='
WHERE
key_id = 'a0545674f583cfc2982ca3ea72c6d5a0e289827a664060d6e5030715ab7b4abd'
AND (
token = 'Q3TsyXJeu/jVrwImFj/kXMeW3xPgxAYqiuOIZHtGtIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)