UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Is8lIR88T2yyel0uSiUXhTfQThXq++C+8mgjkHvabFg='
WHERE
key_id = '682d52569a22b8b8ba72f587053b0098d1eb8ce60986b83e7106c530b263dbbd'
AND (
token = 'Is8lIR88T2yyel0uSiUXhTfQThXq++C+8mgjkHvabFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)