UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q+oTFGquf30lUMSGYgV5iqUlGyVxf9C5SSm4KSURuoA='
WHERE
key_id = 'fb62264429f152e7b479c55eeba2d2ba0793d5e8b5e15403f6efaf90be3333c6'
AND (
token = 'q+oTFGquf30lUMSGYgV5iqUlGyVxf9C5SSm4KSURuoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)