UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BInzBbmP+uWdy+6NZcNSjn46jncpvQT5At2AhNCXK9U='
WHERE
key_id = '6e46f44343ccc88cc265e0d0cee65aa7a04121c9060953e5f80c53a0f19e3d58'
AND (
token = 'BInzBbmP+uWdy+6NZcNSjn46jncpvQT5At2AhNCXK9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)