UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DnfkcC7D217QBE7eEV9V8MhEuLSzd6F/LQSX5f6R2Io='
WHERE
key_id = '499dc75bdec11b9cf466e65733584ae2b0da7c4092522cb30c0f3e885a599b77'
AND (
token = 'DnfkcC7D217QBE7eEV9V8MhEuLSzd6F/LQSX5f6R2Io='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)