UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UW0/Ag7V3kuEkNprEVUcCJbJPa76b35BaxtNKWXplf4='
WHERE
key_id = '1fcc3da18f54e7e2782778973f2120710cdf96cdc936845f3ba1ed8326c060cd'
AND (
token = 'UW0/Ag7V3kuEkNprEVUcCJbJPa76b35BaxtNKWXplf4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)