UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kbUsj3lhDeQHRP8tL26KbQuWhafpWecjVofEcNetynU='
WHERE
key_id = '0c7ed728d0e6363d5c039b6e2c82664ee909fac13c97cb48d324ddc9d7f8e647'
AND (
token = 'kbUsj3lhDeQHRP8tL26KbQuWhafpWecjVofEcNetynU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)