UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GqwDrFnOLckVttxJpJuFCToDHLUvx4Jp4q4bIvHCojo='
WHERE
key_id = '17286d3d4415642aa4a92f5d23ab400f6bed4919451e0c2ac69007616f25c075'
AND (
token = 'GqwDrFnOLckVttxJpJuFCToDHLUvx4Jp4q4bIvHCojo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)