UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yVzVAXogwWarzNxZlKIiVNyLZ+mXVck7fvtxR+UZCTg='
WHERE
key_id = '6b24bd81a97779679dd3ac225036adef74ae1e5dd58f68be533ef1dc685b53b1'
AND (
token = 'yVzVAXogwWarzNxZlKIiVNyLZ+mXVck7fvtxR+UZCTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)