UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yiOBpKbJnqnTSbfXdQpM/4+60OD7XK6YzBaUCbG4Mjg='
WHERE
key_id = '980e9da2160e92174446abaef3a5bf74bc598c9b665ba7b8b7622e73ccc0a70b'
AND (
token = 'yiOBpKbJnqnTSbfXdQpM/4+60OD7XK6YzBaUCbG4Mjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)