UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4yBBM88W65XinegG9ICmptl+UtKncLUE5Cjp51Bzsx4='
WHERE
key_id = '2162f386e5187f43e9e8c911d76d1d2782f4f6151574c8203e5f2e3d2302bc2e'
AND (
token = '4yBBM88W65XinegG9ICmptl+UtKncLUE5Cjp51Bzsx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)