UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cLvmdw1zwKErTR4ufptWzEThqHw344BrxRsQznsvOM8='
WHERE
key_id = '1494a6cc42c1e868d9c6f592fc84ffba68972c25801700298571ea0746c99708'
AND (
token = 'cLvmdw1zwKErTR4ufptWzEThqHw344BrxRsQznsvOM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)