UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y4qp7oStVEQNn9+P7yCCke/flRCjUCrD08wIvfSFVmc='
WHERE
key_id = 'fffae20cb5a275c011c2299abf39f256dadfa4404f2b9cf72ab2a592dff49584'
AND (
token = 'y4qp7oStVEQNn9+P7yCCke/flRCjUCrD08wIvfSFVmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)