UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mKLJOdwy2Ddwz6e/R8mXyaZOkMyYMm3+VHTwLzj7fpw='
WHERE
key_id = 'fbdc6d9b9182b3b9beaa6a6a07237ca9a46c85c8c1f3a0f8465474c4ba984750'
AND (
token = 'mKLJOdwy2Ddwz6e/R8mXyaZOkMyYMm3+VHTwLzj7fpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)