UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sddAosGafkPdXCDX+CTxr+tDKWISNRkwiGpuhKOQdRw=' 
WHERE 
  key_id = '45850a45d7447f394db7335d130357f63a93fbaa7bf0c21fa9938b191ea21a09' 
  AND (
    token = 'sddAosGafkPdXCDX+CTxr+tDKWISNRkwiGpuhKOQdRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048