UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JWlTtiO4b+Sv4XmPFiP1oTNtwUjYCuwQow00gy6m/+g='
WHERE
key_id = '8f8103b99a61355ff17b5730338a18adfa7b3cfb9a1989351fa9e85ec3c1a0c5'
AND (
token = 'JWlTtiO4b+Sv4XmPFiP1oTNtwUjYCuwQow00gy6m/+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)