UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cwR45pOhek5UB/qaqcFKuuG1MAQfLkeWvQ3mjWsYbUM='
WHERE
key_id = '3e7509db6a45fed8493c0da54d7b307557908b647c439b73bfef4526d868139e'
AND (
token = 'cwR45pOhek5UB/qaqcFKuuG1MAQfLkeWvQ3mjWsYbUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)