UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FpmH27ohTiArVoTAx/6nOBoHMB1kGB05n93usjmZcH4='
WHERE
key_id = '32b4df4652cd27aaca310ec7d75019d4c915101f63fbe746a28a0eed8ed41598'
AND (
token = 'FpmH27ohTiArVoTAx/6nOBoHMB1kGB05n93usjmZcH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)