UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3IZOdGqTGBgoMGwqbB6Ti/I4/5Df+cr3PpgRpKGTGVI='
WHERE
key_id = '99230fc76ada2fcbef6898d86ba58f96c41d3e3d36ec4f4a0f86201caa65fee8'
AND (
token = '3IZOdGqTGBgoMGwqbB6Ti/I4/5Df+cr3PpgRpKGTGVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)