UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BStTXD39ArdszrOlal5hw8pSXORfhmOVjUhrCvPdFqw='
WHERE
key_id = 'a75f023cad8311afc0b1535ed22a1ff59d8ce801bbef4ff516f2c800e1e5c446'
AND (
token = 'BStTXD39ArdszrOlal5hw8pSXORfhmOVjUhrCvPdFqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)