UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fglOY6a6xzjCOiorLiBxYxSY8OU06sKPTQLK52EkxLQ='
WHERE
key_id = '255ab07979772b7e7c9c064e7b960444320113976afec7ac29dfaa2ef899e47d'
AND (
token = 'fglOY6a6xzjCOiorLiBxYxSY8OU06sKPTQLK52EkxLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)