UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c2EePg2pmlF0N17xEwSNuF3/Rwes1RSa7wiuN6YGICo='
WHERE
key_id = '5315314fb92198e42f824d5e2f4c970345a563add757846c4bc2102b6c81d8c0'
AND (
token = 'c2EePg2pmlF0N17xEwSNuF3/Rwes1RSa7wiuN6YGICo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)