UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zbVXbXYfE4X0a+2Bwg6VygwdNazRM00ZM8WTANBQF3s='
WHERE
key_id = 'fd152e689fda175624361ef760b940aa47816aa33d3999b52d93019717fda666'
AND (
token = 'zbVXbXYfE4X0a+2Bwg6VygwdNazRM00ZM8WTANBQF3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)